<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: pink;
            /* border: 10px solid black; */
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        // clientWidth,clientHeight不包括border、包括padding
        var div = document.querySelector('div');
        console.log(div.clientWidth);
        console.log(div.clientHeight);
        // clientTop 上边框大小
        // clientLeft 左边框大小
        console.log(div.clientLeft);
        console.log(div.clientTop);
    </script>
</body>
</html>